def hanoi_tower(n):
    count=1
    def hanoi(n,src,dst,mid):
        nonlocal count
        if n == 1:
            print(f'{count}:{src}->{dst}')
            count+=1
        else:
            hanoi(n-1,src,mid,dst)
            print(f'{count}:{src}->{dst}')
            count+=1
            hanoi(n-1,mid,dst,src)
        return count-1
    return hanoi(n,'A','C','B')
